Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
Editing string of an object in an array [Discord.js | mongodb]

i need to edit object string in array using mongoose and discord.js

I have an array of Users, to which I add an object every time I use a command:

Id: member.id,
Rank: rank,
Deposit: 0,
Joined: Date.now(),

enter image description here

guildDb.findOne({ GuildId: guild.id, GuildOwner: status.ownerId }, async (err, docs) => {
   if (err) throw err
   if (!docs) return

   docs.Users.find(x => x.id === user.id).Deposit += +500
   await docs.save().catch(error => console.log(error)
})

It does not change the deposit value and does not even display any error. help?)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!